package com.research.service.impl;

import java.util.List;

import com.research.common.MetaObjectForXmlHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.research.mapper.ResearchUnitAnnalsMapper;
import com.research.domain.entity.ResearchUnitAnnals;
import com.research.service.IResearchUnitAnnalsService;

/**
 * 研究机构-年报记录Service业务层处理
 *
 * @author hst
 * @date 2025-03-13
 */
@Service
public class ResearchUnitAnnalsServiceImpl implements IResearchUnitAnnalsService
{
    @Autowired
    private ResearchUnitAnnalsMapper researchUnitAnnalsMapper;

    /**
     * 查询研究机构-年报记录
     *
     * @param ID 研究机构-年报记录主键
     * @return 研究机构-年报记录
     */
    @Override
    public ResearchUnitAnnals selectResearchUnitAnnalsByID(String ID)
    {
        return researchUnitAnnalsMapper.selectResearchUnitAnnalsById(ID);
    }

    /**
     * 查询研究机构-年报记录列表
     *
     * @param researchUnitAnnals 研究机构-年报记录
     * @return 研究机构-年报记录
     */
    @Override
    public List<ResearchUnitAnnals> selectResearchUnitAnnalsList(ResearchUnitAnnals researchUnitAnnals)
    {
        return researchUnitAnnalsMapper.selectResearchUnitAnnalsList(researchUnitAnnals);
    }

    /**
     * 新增研究机构-年报记录
     *
     * @param researchUnitAnnals 研究机构-年报记录
     * @return 结果
     */
    @Override
    public int insertResearchUnitAnnals(ResearchUnitAnnals researchUnitAnnals)
    {
        MetaObjectForXmlHandler.fillForInsertGenUuid(researchUnitAnnals);
        return researchUnitAnnalsMapper.insertResearchUnitAnnals(researchUnitAnnals);
    }

    /**
     * 修改研究机构-年报记录
     *
     * @param researchUnitAnnals 研究机构-年报记录
     * @return 结果
     */
    @Override
    public int updateResearchUnitAnnals(ResearchUnitAnnals researchUnitAnnals)
    {
        MetaObjectForXmlHandler.fillForUpdate(researchUnitAnnals);
        return researchUnitAnnalsMapper.updateResearchUnitAnnals(researchUnitAnnals);
    }

    /**
     * 批量删除研究机构-年报记录
     *
     * @param IDs 需要删除的研究机构-年报记录主键
     * @return 结果
     */
    @Override
    public int deleteResearchUnitAnnalsByIDs(String[] IDs)
    {
        return researchUnitAnnalsMapper.deleteResearchUnitAnnalsByIds(IDs);
    }

    /**
     * 删除研究机构-年报记录信息
     *
     * @param ID 研究机构-年报记录主键
     * @return 结果
     */
    @Override
    public int deleteResearchUnitAnnalsByID(String ID)
    {
        return researchUnitAnnalsMapper.deleteResearchUnitAnnalsById(ID);
    }
}
